export default {
  state: {
    page: {},
    activities: []
  },

  mutations: {
    SET_ACTIVITIES: (state, { activities, page }) => {
      state.activities = activities
      state.page = page
    }
  },

  actions: {
    FETCH_ACTIVITIES: ({ dispatch, commit }, { params }) => {
      return dispatch('FETCH_ENDPOINT_DATA', {
          endpoint: 'activities',
          params: params
        })
        .then(({ activities, page }) => {
          commit('SET_ACTIVITIES', { activities, page })
        })
    }
  }
}